MkProgressBar
Node to display a CSS-based progress bar.¶
Example: Regular¶
Example: Style thin¶
Example: Style candystripe¶
Example: Style candystripe_animated¶
Bases: MkNode
__init__
¶
__init__(
percentage: int,
*,
label: str | Literal[True] | None = True,
style: Literal["thin", "candystripe", "candystripe_animated"] | None = None,
**kwargs: Any
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
percentage
|
int
|
Percentage value for the progress bar |
required |
label
|
str | Literal[True] | None
|
Label to display on top of progress bar |
True
|
style
|
Literal['thin', 'candystripe', 'candystripe_animated'] | None
|
Progress bar style |
None
|
kwargs
|
Any
|
Keyword arguments passed to parent |
{}
|
Name | Children | Inherits |
---|---|---|
MkNode mknodes.basenodes.mknode Base class for everything which can be expressed as Markup. |
graph TD
94721311921008["mkprogressbar.MkProgressBar"]
94721308848336["mknode.MkNode"]
94721311766592["node.Node"]
140564252373184["builtins.object"]
94721308848336 --> 94721311921008
94721311766592 --> 94721308848336
140564252373184 --> 94721311766592
/home/runner/work/mknodes/mknodes/mknodes/basenodes/mkprogressbar/metadata.toml
[metadata]
icon = "fa6-solid:bars-progress"
name = "MkProgressBar"
[[resources.css]]
filename = "progressbar.css"
[requirements.extension."pymdownx.progressbar"]
[examples.regular]
title = "Regular"
jinja = """
{{ 60 | MkProgressBar }}
"""
[examples.style_thin]
title = "Style thin"
jinja = """
{{ 60 | MkProgressBar(style="thin") }}
"""
[examples.style_candystripe]
title = "Style candystripe"
jinja = """
{{ 70 | MkProgressBar(style="candystripe") }}
"""
[examples.style_candystripe_animated]
title = "Style candystripe_animated"
jinja = """
{{ 80 | MkProgressBar(style="candystripe_animated") }}
"""
[output.markdown]
template = """
[={{ node.percentage }}% "{{ node.label }}"]
"""
[output.html5]
template = """
<label for="progress_bar">{{ node.label }}:</label>
<progress id="progress_bar" max="100" value="{{ node.percentage }}">{{ node.percentage }}%</progress>
"""